﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:properties="clr-namespace:MOCSoftware.Utilities.JpgMetaDataViewer.Properties"
                    xmlns:viewModel="clr-namespace:MOCSoftware.Utilities.JpgMetaDataViewer.Viewmodel"
                    xmlns:view="clr-namespace:MOCSoftware.Utilities.JpgMetaDataViewer.View"
                    >

    <Style TargetType="{x:Type Window}" x:Key="Main">
        <Setter Property="MinHeight" Value="480" />
        <Setter Property="MinWidth" Value="640" />
    </Style>

    <DataTemplate DataType="{x:Type viewModel:ImageViewModel}">
        <view:ImageView></view:ImageView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:MetaDataViewModel}">
        <view:MetaDataView></view:MetaDataView>
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:MainMenuViewModel}">
        <view:MainMenuView />
    </DataTemplate>

    <DataTemplate DataType="{x:Type viewModel:MenuItemViewModel}" x:Key="ContextMenuTemplate">
        <StackPanel Orientation="Horizontal">
            <Label Content="{Binding Header}" />
        </StackPanel>
    </DataTemplate>

    <BooleanToVisibilityConverter x:Key="BoolToVisibility" />

    <LinearGradientBrush x:Key="Brush_HeaderBackground" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#66000088" Offset="0" />
        <GradientStop Color="#BB000088" Offset="1" />
    </LinearGradientBrush>

    <LinearGradientBrush x:Key="Brush_MessageHeaderBackground" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFFF0000" Offset="0" />
        <GradientStop Color="#FFC00000" Offset="1" />
    </LinearGradientBrush>

    <Style x:Key="DialogHeader" TargetType="{x:Type Label}">
        <Setter Property="Background" Value="{StaticResource Brush_HeaderBackground}" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="Opacity" Value="1.0" />
        <Setter Property="FontFamily" Value="Arial" />
    </Style>
    <Style x:Key="MessageDialogHeader" TargetType="{x:Type Label}" BasedOn="{StaticResource DialogHeader}">
        <Setter Property="Background" Value="{StaticResource Brush_MessageHeaderBackground}" />
    </Style>
    
    <Style x:Key="DialogBody" TargetType="{x:Type ContentControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <Grid
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        >
                            <Label  Background="Gray" Opacity="0.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="5" />
                            <Border Opacity="1.0"
                        Background="{StaticResource Brush_HeaderBackground}" 
                        BorderBrush="Black" 
                        BorderThickness="1" 
                        CornerRadius="5" 
                        Margin="4" 
                        Padding="4" 
                        SnapsToDevicePixels="True" 
                        Panel.ZIndex="10"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        >
                                <ContentPresenter
                            ContentSource="Content"
                            ContentTemplate="{TemplateBinding ContentTemplate}" />
                            </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Visibility" Value="{Binding Path=IsVisible,Converter={StaticResource BoolToVisibility}}" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Style.Resources>
            <Style TargetType="{x:Type StackPanel}">
                <Setter Property="Background" Value="AliceBlue" />
                <Setter Property="Opacity" Value="1.0" />
                <Setter Property="HorizontalAlignment" Value="Stretch" />
                <Setter Property="VerticalAlignment" Value="Stretch" />
            </Style>
            <Style TargetType="{x:Type Grid}">
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
            <Style TargetType="{x:Type ContentControl}">
                <Setter Property="Margin" Value="5" />
            </Style>
        </Style.Resources>
    </Style>

    <Style TargetType="{x:Type MenuItem}">
        <Setter Property="Command" Value="{Binding Command}" />
        <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
    </Style>

    <HierarchicalDataTemplate x:Key="MainMenuTemplate" DataType="{x:Type viewModel:MenuItemViewModel}" ItemsSource="{Binding Path=MenuItems}">
        <StackPanel>
            <Label Name="mnuiDetails" Content="{Binding Header}" />
        </StackPanel>
    </HierarchicalDataTemplate>

    <Style x:Key="TitleStyle" TargetType="{x:Type Label}">
        <Setter Property="Margin" Value="0,0,0,0" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="FontSize" Value="18"></Setter>
        <Setter Property="FontWeight" Value="Bold"></Setter>
    </Style>

    <Style TargetType="Label" x:Key="AboutLabel">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Margin" Value="5,0,5,5" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="FontWeight" Value="Bold" />
    </Style>

    <Style TargetType="TextBlock" x:Key="About">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="Margin" Value="5,5,5,5" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="TextWrapping" Value="Wrap" />
    </Style>
</ResourceDictionary>